Skip to content

Conversation

Vizit0r
Copy link
Contributor

@Vizit0r Vizit0r commented Aug 8, 2019

… Win 86&64, Mac x32, should work on NEXTGEN as well.

  1. correction for NEXTGEN compiler support in progress - no any compilation error, but still huge problems due to ARC.
  2. added parameter FinalCleaning (default - True) to TPSPascalCompiler.Compile - for cleaning of unused stuff - memory leakage removed. For debug run - set to False.
  3. added return value to TPSExecuteEvent (for compilation break in case of unsuccessful import)
  4. raising of Exception changed to InternalScriptException - for filtering exceptions by class, f.e. in EurekaLog, madExcept and other exception handlers.
  5. removed StrToDate from uPSC_dateutils - duplication from uPSI_SysUtils
  6. in uPSDebugger added 3 methods (more info from debugger)
  7. Added IncMinute and similar methods import to uPSR_dateutils - before were only in uPSC_dateutils
  8. in uPSRuntime added more informative messages in case of Array out ob bounds, and few more.
  9. small fixes and changes here and there.

on next commit will be added example of PS in thread work, and fully-functional debugger.

… Win 86&64, Mac x32, should work on NEXTGEN as well.

2) correction for NEXTGEN compiler support in progress - no any compilation error, but still huge problems due to ARC.
3) added parameter FinalCleaning (default - True) to TPSPascalCompiler.Compile - for cleaning of unused stuff - memory leakage removed. For debug run - set to False.
4) added return value to TPSExecuteEvent (for compilation break in case of unsuccessful import)
5) raising of Exception changed to InternalScriptException - for filtering exceptions by class, f.e. in EurekaLog, madExcept and other exception handlers.
6) removed StrToDate from uPSC_dateutils - duplication from uPSI_SysUtils
7) in uPSDebugger added 3 methods (more info from debugger)
8) Added IncMinute and similar methods import to uPSR_dateutils - before were only in uPSC_dateutils
9) in uPSRuntime added more informative messages in case of Array out ob bounds, and few more.
10) small fixes and changes here and there.

on next commit will be added example of PS in thread work, and fully-functional debugger.
@martijnlaan
Copy link
Collaborator

This pull request should be broken up in multiple smaller pull requests, there's a lot of unrelated stuff together now. Also it contains several TODOs like "TODO add and test: btInterface".

@Vizit0r
Copy link
Contributor Author

Vizit0r commented Aug 8, 2019

Also it contains several TODOs like "TODO add and test: btInterface".
same, as contained in original PS methods calling includes for a 10 years )))

okey, will divide this pull for few multiply. Delete it from pull request pls.

@evgeny-k evgeny-k closed this Aug 9, 2019
Copy link
Collaborator

@martijnlaan martijnlaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a test of the debugger callstack functionality. It worked well 👍 I have 3 comments.

@@ -52,7 +52,13 @@ TPSCustomDebugExec = class(TPSExec)
property CurrentProcParams: TIfStringList read GetCurrentProcParams;

function GetGlobalVar(I: Cardinal): PIfVariant;


function GetProcNo(Proc : TPSInternalProcRec) : Cardinal;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TPSExec already has a GetProcNo with a different prototype so this changes breaks compilation of all code which uses TPSDebugExec and was already calling that GetProcNo. I think this new one should have a different name.

end;

begin
Result := 'Call Stack:' + #13#10
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be up to the caller to add this header if desired.

if (ParamList.Items[l] = 'Result') or (ParamList.Items[l] = '') then
Continue
else
Result:=Result+ ParamList.Items[l]+':"'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of " seems odd to me. Would probably be better to remove this? Or at least make it a single quote but that still seems odd and also is inconsisten with variably evaluation while debugging.

@martijnlaan
Copy link
Collaborator

same, as contained in original PS methods calling includes for a 10 years )))

Ah, ok, sorry.

okey, will divide this pull for few multiply.

Cool. In case you're not aware: you need to use branches for this in your repo.

martijnlaan pushed a commit to jrsoftware/issrc that referenced this pull request Aug 10, 2019
… Stack" view now shows the call stack.

Requires the callstack functionality from remobjects/pascalscript#203, with some fixes.
@martijnlaan
Copy link
Collaborator

@Vizit0r I integrated the debugger call stack functionality into Inno Setup. Thanks. If you want I can commit this part so you don't have to create a pull request for it. This would include changes for the above comments and some other tweaks. I also noticed that the GetCallStackCount doesn't actually return a correct number if a function with parameters is on the call stack. Can fix that too.

@Vizit0r
Copy link
Contributor Author

Vizit0r commented Aug 11, 2019

of course, do that, especially if you find something incorrect.
I check my sources - GetProcNo from TPSDebugExec used no longer and can be removed.

Please also include in your commit line
property CurrUsedTypeNo: Cardinal read FCurrUsedTypeNo;
to TPSPascalCompiler (file uPSCompiler.pas), also using for debug purposes.

martijnlaan pushed a commit that referenced this pull request Aug 15, 2019
…s and cleanup. Does not yet display parameter values, nor does it return position information.
@pult
Copy link

pult commented Sep 20, 2019

Failed compilation on previous delphi versions and do not work.
Need fix:

uPSRuntime.pas

{$UNDEF _INVOKECALL_INC_}
{---?$IFDEF DELPHI2010UP} // TODO: not compiled for all delphi compilers
{$IFDEF DELPHI23UP}    // DELPHI2010UP == DELPHI14UP
  {$IFDEF AUTOREFCOUNT}
    {$fatal Pascal Script does not supports compilation with AUTOREFCOUNT at the moment!}
  {$ELSE}
    {$include InvokeCall.inc}
    {$DEFINE _INVOKECALL_INC_}
  {$ENDIF}
{$ELSE}

...

try
  {$IFDEF _INVOKECALL_INC_}
  Result := Caller.InnerfuseCall(FSelf, p.Ext1, TPSCallingConvention(Integer(cc) or 64), MyList, v);
  {$ELSE}
  Result := Caller.InnerfuseCall(FSelf, p.Ext1, {$IFDEF FPC}TPSCallingConvention(Integer(cc) or 64){$ELSE}cc{$ENDIF}, MyList, v);
  {$ENDIF}
finally
  DisposePPSVariantIFC(v);
  DisposePPSVariantIFCList(mylist);
  DestroyHeapVariant(intval);
end;
end;

function ClassCallProcVirtualConstructor(Caller: TPSExec; p: TPSExternalProcRec; Global, Stack: TPSStack): Boolean;
...

try
  {$IFDEF _INVOKECALL_INC_}
  Result := Caller.InnerfuseCall(FSelf, VirtualClassMethodPtrToPtr(p.Ext1, FSelf), TPSCallingConvention(Integer(cc) or 128), MyList, v);
  {$ELSE}
  Result := Caller.InnerfuseCall(FSelf, VirtualClassMethodPtrToPtr(p.Ext1, FSelf), {$IFDEF FPC}TPSCallingConvention(Integer(cc) or 128){$ELSE}cc{$ENDIF}, MyList, v);
  {$ENDIF}
finally
  DisposePPSVariantIFC(v);
  DisposePPSVariantIFCList(mylist);
  DestroyHeapVariant(intval);
end;
end;

function CastProc(Caller: TPSExec; p: TPSExternalProcRec; Global, Stack: TPSStack): Boolean;

...

pult referenced this pull request Sep 20, 2019
…pc etc) for Delphi 2010+. (#207)

Tested on Win x86&x64, Android, MacOS32 - no problems observed.

2) Changes for correct MACOS compilation in Delphi

3) few changes and fixes for correct work on D7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants